package file;

import java.io.File;
import java.io.FileFilter;


/*文件过滤器Lambda版本*/
public class ListFilesDemo3 {
    public static void main(String[] args) {
        File dir = new File(".");
        if(dir.isDirectory()){
            File []sum = dir.listFiles (pathname -> pathname.getName().endsWith(".txt"));
            for (File sums : sum){
                System.out.println(sums.getName());
            }
        }

    }
}
